`timescale  1ns / 1ps

module tb_aes_top;

// aes_top Parameters
parameter PERIOD  = 10;


// aes_top Inputs
reg   clk                                  = 0 ;
reg   rst_n                                = 0 ;
reg   keyexp                               = 0 ;
reg   encode                               = 0 ;
reg   [127:0]  key                         = 0 ;
reg   [127:0]  txt                         = 0 ;

// aes_top Outputs
wire  keyexp_done                          ;
wire  encode_done                          ;
wire  [127:0]  out                         ;


initial
begin
    forever #(PERIOD/2)  clk=~clk;
end

initial
begin
    #(PERIOD*2) rst_n  =  1;
end

aes_top  u_aes_top (
    .clk                     ( clk                  ),
    .rst_n                   ( rst_n                ),
    .keyexp                  ( keyexp               ),
    .encode                  ( encode               ),
    .key                     ( key          [127:0] ),
    .txt                     ( txt          [127:0] ),

    .keyexp_done             ( keyexp_done          ),
    .encode_done             ( encode_done          ),
    .out                     ( out          [127:0] )
);

initial
begin
    #(PERIOD  * 2);
    key = 128'h2b7e151628aed2a6abf7158809cf4f3c;
    txt = 128'h3243f6a8885a308d313198a2e0370734;
    keyexp = 1;
    #(PERIOD);
    keyexp = 0;
    @(negedge keyexp_done);
    #(PERIOD);
    encode = 1;
    #(PERIOD);
    encode = 0;
    @(negedge encode_done);

    #(PERIOD*10);
    $stop;
end

endmodule